package com.kantboot.io.exception;

import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class CesUserException extends RuntimeException {

    /**
     * 错误时返回的id
     */
    private Integer id;

    /**
     * 错误时返回的信息
     */
    private String message;

    public CesUserException(Integer id, String message){
        super(message);
        setId(id);
        setMessage(message);
    }

    public static CesUserException usernameNotUniqueException()
    {
        return new CesUserException(6001,"用户名出现重复！");
    }
    public static CesUserException nicknameNotUniqueException()
    {
        return new CesUserException(6002,"昵称出现重复！");
    }
    public static CesUserException phoneNumberNotUniqueException()
    {
        return new CesUserException(6003,"手机号出现重复！");
    }
    public static CesUserException userNullException()
    {
        return new CesUserException(6004,"账号不存在！");
    }
    public static CesUserException passwordFailedException()
    {
        return new CesUserException(6005,"密码错误！");
    }



}
